package com.ruoyi.system.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.List;

/**
 * 作品类别对象 act_category
 *
 * @author ruoyi
 * @date 2021-11-27
 */
public class ActCategory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /**  */
    private Long id;

    /** 父类别ID */
    private Long parentId;

    /** 祖级列表 */
    private String ancestors;

    /** 类别名称 */
    @Excel(name = "类别名称")
    private String name;

    /** 排序 */
    @Excel(name = "排序")
    private Long orderNum;

    /** 删除标识 */
    private String delFlag;

    /** 类别编码 */
    @Excel(name = "类别编码")
    private String categoryCode;

    /**
     * 子类别
     */
    private List<ActCategory> children;

    public boolean hasChildren(){
        if(children != null && children.size() >0){
            return true;
        }
        return false;
    }

    public List<ActCategory> getChildren() {
        return children;
    }

    public void setChildren(List<ActCategory> children) {
        this.children = children;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setName(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }
    public void setOrderNum(Long orderNum)
    {
        this.orderNum = orderNum;
    }

    public Long getOrderNum()
    {
        return orderNum;
    }
    public void setDelFlag(String delFlag)
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag()
    {
        return delFlag;
    }
    public void setCategoryCode(String categoryCode)
    {
        this.categoryCode = categoryCode;
    }

    public String getCategoryCode()
    {
        return categoryCode;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getAncestors() {
        return ancestors;
    }

    public void setAncestors(String ancestors) {
        this.ancestors = ancestors;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getName())
            .append("orderNum", getOrderNum())
            .append("remark", getRemark())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("categoryCode", getCategoryCode())
            .toString();
    }
}
